/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package org.springside.examples.quickstart.service.demo;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.whty.emalls.common.dao.SqlDao;
import com.whty.emalls.common.model.MbUser;

// Spring Bean的标识.
@Component
// 类中所有public函数都纳入事务管理的标识.
@Transactional
public class DemoService {

	@Resource
	private SqlDao sqlDao;
	
	public MbUser findUserById(String id){
		return (MbUser) sqlDao.view("MbUser.findById", id);
	}
	
	public void deleteUser(String id){
		sqlDao.delete("MbUser.deleteById", id);
	}
}
